<template>
  <div>
    <el-container>
      <!-- 顶部区域 -->
      <el-header>
        <h2>留言板</h2>
      </el-header>
      <!-- 主体区域 -->
      <el-main>
        <el-card class="box-card">
          <div v-for="(item,index) in messageBoard" :key="index" class="text item">
            {{item}}
          </div>
        </el-card>
      </el-main>
      <!-- 底部区域 -->
      <el-footer>
        <el-input type="textarea" placeholder="请输入内容" v-model="message" maxlength="30" show-word-limit @keyup.enter="enter">
        </el-input>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        message: '',
        messageBoard: ['111', '222', '3333', '4444'],
      }
    },
    methods: {
      enter(){
       this.messageBoard = this.messageBoard.push(this.message)
      }
    },
  }
</script>

<style lang="less" scope>

</style>